package com.drinks.yiniang.entity.goods;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.hansen.library.entity.BaseJson;

import java.util.List;

/**
 * 搜索商品json
 * @author han
 * @date 2019/11/5
 */
public class SearchGoodsJson extends BaseJson {

    public static final int ITEM_TYPE_SEARCH_GOODS_LIST = 0x01;//搜索的商品
    public static final int ITEM_TYPE_SEARCH_GOODS_TITLE = 0x02;//推荐饮品标题

    private SearchGoodsData data;

    public SearchGoodsData getData() {
        return data;
    }

    public void setData(SearchGoodsData data) {
        this.data = data;
    }

    public static class SearchGoodsData {
        private List<SearchGoodsList> data;

        public List<SearchGoodsList> getData() {
            return data;
        }

        public void setData(List<SearchGoodsList> data) {
            this.data = data;
        }
    }

    public static class SearchGoodsList extends GoodsJson.GoodsList implements MultiItemEntity {
        private int mItemType = ITEM_TYPE_SEARCH_GOODS_LIST;

        public void setItemType(int mItemType) {
            this.mItemType = mItemType;
        }

        @Override
        public int getItemType() {
            switch (mItemType) {
                case ITEM_TYPE_SEARCH_GOODS_LIST:
                case ITEM_TYPE_SEARCH_GOODS_TITLE:
                    return mItemType;
                default:
                    return BaseMultiItemQuickAdapter.TYPE_NOT_FOUND;

            }
        }
    }
}
